﻿using System;
using Sharp.DataTransferObject.CMS;
using Sharp.Domain.CMSBoundedContext.MemberModule.Aggregates;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Crosscutting;
using Sharp.Infrastructure.Search;

namespace Sharp.Application.CMS
{
    public partial class MemberServiceImpl  
    {
        public PagedResult<CommentDTO> GetCommentPaged(PagingFeature pf)
        {
            var paged = _commentRepository.Pagging(pf,null, t => t.VIU);

            return paged.To<Comment, CommentDTO>();
        }

        [Logging("删除采集规则，Id：{@p0}")]
        public Result DeleteComments(Guid[] ids)
        {
            var res = new Result();
            if (ids == null)
            {
                res.Err = "参数不可为空。";
                return res;
            }

            _commentRepository.Remove(ids);

            Context.Commit();

            return res;
        }
    }
}
